package terra.network.packet.server;

import org.jboss.netty.buffer.ChannelBuffer;

import terra.network.packet.Packet;

public class Resurection extends Packet {

	public float x,y;
	public int oId;
	
	public Resurection(int i, float f, float g) {
		oId = i;
		x = f;
		y = g;
	}
	
	public Resurection(){
	}

	@Override
	public ChannelBuffer toBuffer() {
		ChannelBuffer buf = getNewBuffer();
		buf.writeByte(getId());		
		buf.writeInt(oId);	
		buf.writeFloat(x);
		buf.writeFloat(y);	
		return buf;
	}

	@Override
	public Packet fromBuffer(ChannelBuffer buf) {
		oId = buf.readInt();
		x = buf.readFloat();
		y = buf.readFloat();
		return this;
	}

	@Override
	public int getLength() {
		return 13;
	}

	@Override
	public boolean isDynamicLength() {
		return false;
	}

	@Override
	public byte getId() {
		return 25;
	}
	
	@Override
	public byte getPriority() {
		return PRIOR_HIGH;
	}

}
